<?php

/**
 * talleres actions.
 *
 * @package    atenea
 * @subpackage talleres
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
 */
class talleresActions extends autotalleresActions
{
  
public function executeIndex()
  {
  	$objtaller=new Taller();
    $objtaller->getActEstatus();
  	return $this->forward('talleres', 'list');
  }

  public function executeList()
  {
    $this->processSort();

    $this->processFilters();
   
     
    $objtaller=new Taller();
    $objtaller->getActEstatus();
    
    
    // pager
    $this->pager = new sfPropelPager('Taller', 8);
    $c = new Criteria();
    $this->addSortCriteria($c);
    $this->addFiltersCriteria($c);
    $this->pager->setCriteria($c);
    $this->pager->setPage($this->getRequestParameter('page', 1));
    $this->pager->init();
  }

  
  
  protected function processFilters()
  {
  }

  protected function processSort()
  {
    if ($this->getRequestParameter('sort'))
    {
      $this->getUser()->setAttribute('sort', $this->getRequestParameter('sort'), 'sf_admin/taller/sort');
      $this->getUser()->setAttribute('type', $this->getRequestParameter('type', 'asc'), 'sf_admin/taller/sort');
    }

    if (!$this->getUser()->getAttribute('sort', null, 'sf_admin/taller/sort'))
    {
    }
  }

  protected function addFiltersCriteria($c)
  {
  }

  protected function addSortCriteria($c)
  {
    if ($sort_column = $this->getUser()->getAttribute('sort', null, 'sf_admin/taller/sort'))
    {
      $sort_column = TallerPeer::translateFieldName($sort_column, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_COLNAME);
      if ($this->getUser()->getAttribute('type', null, 'sf_admin/taller/sort') == 'asc')
      {
        $c->addAscendingOrderByColumn($sort_column);
      }
      else
      {
        $c->addDescendingOrderByColumn($sort_column);
      }
    }
  }

  protected function getLabels()
  {
    return array(
      'taller{id}' => 'Id:',
      'taller{nom_taller}' => 'Taller:',
      'taller{num_sesiones}' => 'Nº Sesiones:',
      'taller{num_horas}' => 'Nº Horas:',
      'taller{observaciones}' => 'Observaciones:',
      'taller{invitado_id}' => 'Invitado:',
      'taller{estatus}' => 'Estatus:',
      'taller{fecha}' => 'Fecha:',
      'taller{lugar}' => 'Lugar:',
      'taller{cupos}' => 'Cupos:',
      'taller{hora_inicio}' => 'Hora inicio:',
      'taller{hora_final}' => 'Hora final:',
    );
  }
	
  
}
